<?php
if (!($fp = fopen('date.txt', 'w'))) {
    return;
}
$year=2014;
$month=06;
$day=06;
fprintf($fp, "%04d-%02d-%02d", $year, $month, $day);
var_dump($_SERVER);